const http = require('http');

let count = 0;
const server  = http.createServer(function (request,response) {
    response.write(`你是第${count++}个访问用户`);
    if(count ===10){
        //while(true);
        console.log('第10个输出');
    }
    response.end();
});


server.listen(8080,(error)=>{
    if(error)
        throw error;
    console.log('成功启动web服务,端口:8080 ');
})